using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;

namespace UDS.Management.Data.Package
{
    public class PackageLoader
    {
        private ResourceCatalog catalog;

        public PackageLoader()
        {
        }

        public void LoadPackages(Assembly assembly)
        {
            catalog = new ResourceCatalog(assembly);
        }

        public ICollection<string> GetPackageNames()
        {
            return catalog.GetPackages();
        }

        public IDBPackage GetPackage(string packageName)
        {
            return new ResourceDBPackage(catalog.GetDBManifestDescritpion(packageName));
        }
    }
}
